<?php use_helper('I18N') ?>
<?php $routes = $sf_context->getRouting()->getRoutes() ?>

<form action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
  <table>
    <?php if($form->hasGlobalErrors()):?>
      <thead>
        <tr><td colspan="3" class="global-error"><?php echo $form->renderGlobalErrors() ?></td></tr>
      </thead>
    <?php endif; ?>
    <tbody>
      <?php foreach ($form as $widget):?>
        <?php if(!$widget->isHidden() && $widget->getName() != 'remember'): ?>
          <tr>
            <td><?php echo $widget->renderLabel() ?></td>
            <td><?php echo $widget->render() ?></td>
            <?php if($widget->hasError()): ?>
              <td><?php echo $widget->renderError() ?></td>
            <?php endif; ?>
          </tr>
        <?php endif; ?>
      <?php endforeach; ?>
      <tr class="signin-footer">
        <td></td>
        <td><?php echo $form['remember']->render(), $form['remember']->renderLabel() ?></td>
      </tr>
      <?php echo $form->renderHiddenFields() ?>
    </tbody>
    <tfoot>
      <tr>
        <td></td>
        <td colspan="2">
          <input type="submit" value="<?php echo __('Signin') ?>">  
          <?php if (isset($routes['sf_guard_register'])): ?>
            &nbsp;<?php echo __('or') ?>&nbsp;<a href="<?php echo url_for('@sf_guard_register') ?>"><?php echo __('Want to register?') ?></a>
          <?php endif; ?>
        </td>
      </tr>
    </tfoot>
  </table>
  
  <?php if (isset($routes['sf_guard_forgot_password'])): ?>
      <a href="<?php echo url_for('@sf_guard_forgot_password') ?>"><?php echo __('Forgot your password?') ?></a>
  <?php endif; ?>
</form>